package com.wc.alorithm_blue_bridge._DFS.分考场;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.util.StringTokenizer;

/**
 * @Author congge
 * @Date 2024/9/9 16:22
 * @description https://www.lanqiao.cn/problems/109/learning/?page=1&first_category_id=1&second_category_id=3
 */
public class Main {
    static FastReader sc = new FastReader();
    static PrintWriter out = new PrintWriter(System.out);
    static int N = 110;
    static boolean[][] g = new boolean[N][N];
    static int[][] room = new int[N][N];
    static int n, m, res;

    public static void main(String[] args) {
        n = sc.nextInt();
        m = sc.nextInt();
        res = n;
        while (m-- > 0) {
            int a = sc.nextInt(), b = sc.nextInt();
            g[a][b] = g[b][a] = true;
        }
        dfs(1, 1);
        out.println(res);
        out.flush();
    }

    /**
     * @param u 第几个学生
     * @param k 创建了几个房间
     */
    static void dfs(int u, int k) {
        if (k >= res) return;
        if (u > n) {
            res = k;
            return;
        }
        // 检查是否有房间能放该学生
        for (int i = 1; i <= k; i++) {
            int j = 0;
            // 该位置有人并且互相不认识, 说明可以在同一个房间
            while (room[i][j] != 0 && !g[room[i][j]][u]) {
                j++;
            }
            if (room[i][j] == 0) {
                room[i][j] = u;
                dfs(u + 1, k);
                room[i][j] = 0;
            }
        }
        // 单独开房间
        room[k + 1][0] = u;
        dfs(u + 1, k + 1);
        room[k + 1][0] = 0;
    }
}


class FastReader {
    StringTokenizer st;
    BufferedReader br;

    FastReader() {
        br = new BufferedReader(new InputStreamReader(System.in));
    }

    String next() {
        while (st == null || !st.hasMoreElements()) {
            try {
                st = new StringTokenizer(br.readLine());
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
        return st.nextToken();
    }

    int nextInt() {
        return Integer.parseInt(next());
    }

    String nextLine() {
        String s = "";
        try {
            s = br.readLine();
        } catch (IOException e) {
            e.printStackTrace();
        }
        return s;
    }

    long nextLong() {
        return Long.parseLong(next());
    }

    double nextDouble() {
        return Double.parseDouble(next());
    }

    // 是否由下一个
    boolean hasNext() {
        while (st == null || !st.hasMoreTokens()) {
            try {
                String line = br.readLine();
                if (line == null)
                    return false;
                st = new StringTokenizer(line);
            } catch (IOException e) {
                throw new RuntimeException(e);
            }
        }
        return true;
    }
}